import request from '@/utils/request'

import Qs from 'qs'

//列表
export function getcourseList(data) {
  return request({
    url: 'package',
    method: 'get',
    params: data,
    headers: {
      'showLoading': true
    }
  })
}
//评论列表
export function evaluateList(data) {
  return request({
    url: 'comment',
    method: 'get',
    params: data,
    headers: {
      'showLoading': '.replyArea'
    }
  })
}
//评论详情
export function commentinfo(data) {
  return request({
    url: 'comment/info',
    method: 'get',
    params: data,
    headers: {
      'showLoading': false
    }
  })
}
//修改显示状态
export function commentoperate(data) {
  return request({
    url: 'comment/operate',
    method: 'put',
    headers: {
      'showLoading': false
    },
    data

  })
}
//回复
export function commentreply(data) {
  return request({
    url: 'comment/reply',
    method: 'POST',
    params: data,
    headers: {
      'showLoading': false
    }
  })
}
//获取子评论
export function commentchildren(data) {
  return request({
    url: 'comment/children',
    method: 'GET',
    params: data,
    headers: {
      'showLoading': false
    }
  })
}
//新增
export function createItem(data) {
  return request({
    url: 'package/create',
    method: 'post',
    data
  })
}

//详情
export function readData(data) {
  return request({
    url: 'package/read',
    method: 'get',
    params: data,
    headers: {
      'showLoading': false,
      'loadingTarget': '.innerloding'
    }
  })
}

//编辑
export function updateData(data) {
  return request({
    url: 'package/update',
    method: 'put',
    data
  })
}

//删除
export function deleteItem(data) {
  return request({
    url: 'package/delete',
    method: 'delete',
    data
  })
}

//更新状态
export function updateStateData(data) {
  return request({
    url: 'package/updateState',
    method: 'put',
    data
  })
}

//修改排序

export function updatesort(data) {
  return request({
    url: 'package/updatesort',
    method: 'put',
    data
  })
}

// 修改热门状态

export function updateIsHot(data) {
  return request({
    url: 'package/updateIsHot',
    method: 'put',
    data
  })
}

// 置顶

export function CommentoperateTop(data) {
  return request({
    url: 'Comment/operateTop',
    method: 'put',
    data
  })
}
// 模板列表

export function commenttemplate(data) {
  return request({
    url: 'comment/template',
    method: 'get',
    params: data,
  })
}
// 模板状态修改

export function commentupdateStatus(data) {
  return request({
    url: 'comment/template/updateStatus',
    method: 'put',
    headers: {
      'showLoading': false
    },
    data,
  })
}

// 新增模板

export function commenttemplatecreate(data) {
  return request({
    url: 'comment/template/create',
    method: 'post',
    headers: {
      'showLoading': false
    },
    data,
  })
}
// 修改模板

export function commenttemplateupdate(data) {
  return request({
    url: 'comment/template/update',
    method: 'put',
    headers: {
      'showLoading': false
    },
    data,
  })
}
// 模板详情

export function commenttemplateread(data) {
  return request({
    url: 'comment/template/read',
    method: 'get',
    headers: {
      'showLoading': false
    },
   params: data,
  })
}
// 模板删除

export function commenttemplatedelete(data) {
  return request({
    url: 'comment/template/delete',
    method: 'delete',
    headers: {
      'showLoading': false
    },
   params: data,
  })
}
// 模板下拉

export function commenttemplateoption(data) {
  return request({
    url: 'comment/template/option',
    method: 'get',
    headers: {
      'showLoading': false
    },
   params: data,
  })
}
export function worryfree(data) {
  return request({
    url: 'package/worryfree',
    method: 'get',
    headers: {
      'showLoading': true
    },
   params: data,
  })
}
export function packageWorryfree(data) {
  return request({
    url: 'package/worryfree',
    method: 'put',
    headers: {
      'showLoading': false
    },
   data,
  })
}
